#pragma once

#include "http-session.h"


class HttpSessionOnTCP : public HttpSession {
public:
	HttpSessionOnTCP(HttpServer &server, tcp::socket &&socket);

	virtual ~HttpSessionOnTCP();

protected:
	virtual void asyncReadHttpRequest(UnderRequestBuffer &requestBuffer, UnderRequest &request, std::function<void(std::error_code ec, size_t readn)> &&cb) override;

	virtual void asyncWriteHttpResponse(const UnderResponse &response, std::function<void(std::error_code ec, size_t readn)> &&cb) override;

private:
	tcp::socket socket_;
};
